import request from '@/utils/request'

/* 商品接口 */

// 分页
export function getGoodPage(data) {
  return request({
    url: '/commodity/page',
    method: 'post',
    data
  })
}

// 删除
export function deleteGoodById(id) {
  return request({
    url: `/commodity/${id}`,
    method: 'delete'
  })
}

// 新增
export function addGood(data) {
  return request({
    url: '/commodity',
    method: 'post',
    data
  })
}

// 详情
export function getGoodDetailById(id) {
  return request({
    url: `/commodity/${id}`,
    method: 'post'
  })
}

// 修改
export function updateGood(data) {
  return request({
    url: '/commodity',
    method: 'put',
    data
  })
}
